var n
  // i.d(t, {
  //   X3: () => p,
  //   bY: () => g,
  //   VV: () => v,
  //   fy: () => h,
  //   lV: () => d,
  //   Uq: () => c,
  //   m: () => f,
  //   id: () => m,
  //   xf: () => u
  // }),
;(function (e) {
  ;(e.COMMENT = "comment"), (e.MATTERTAG = "mattertag")
})(n || (n = {}))

import assetTypeEnum from "../enum/assetType.enum"
var s = {
  IMAGE: "image",
  PDF: "pdf",
  RICH: "rich",
  VIDEO: "video",
  ZIP: "zip"
}

import l from "../packages/91735"
import extEnum from "../enum/ext.enum"
import attachmentEnum from "../enum/attachment.enum"
function c(e) {
  return !(e.category !== attachmentEnum.UPLOAD || !e.mimeType) && l.t8.includes(e.mimeType)
}
function h(e, t) {
  return t ? { width: l.VB, height: l.RW } : e ? { width: l.fn, height: l.vH } : { width: l.m, height: l.KI }
}
function d(e) {
  return e.category === attachmentEnum.EXTERNAL || (!!e.mimeType && l.Aw.includes(e.mimeType))
}
function u(e) {
  switch (e) {
    case n.COMMENT:
      return assetTypeEnum.COMMENT
    case n.MATTERTAG:
      return assetTypeEnum.MATTERTAG
    default:
      throw Error(`Unknown parent type ${e}`)
  }
}
function p(e) {
  switch (e) {
    case assetTypeEnum.NOTE:
    case assetTypeEnum.COMMENT:
      return n.COMMENT
    case assetTypeEnum.MATTERTAG:
      return n.MATTERTAG
    default:
      throw Error(`Unknown asset type ${e}`)
  }
}
function m(e) {
  return e.startsWith("image")
    ? extEnum.IMAGE
    : e.startsWith("video")
    ? extEnum.VIDEO
    : e.startsWith("audio")
    ? extEnum.AUDIO
    : e.startsWith("model")
    ? extEnum.MODEL
    : e.startsWith("text")
    ? extEnum.TEXT
    : "application/pdf" === e
    ? extEnum.PDF
    : extEnum.APPLICATION
}
function g(e) {
  switch (e) {
    case s.IMAGE:
      return extEnum.IMAGE
    case s.PDF:
      return extEnum.PDF
    case s.VIDEO:
      return extEnum.VIDEO
    case s.RICH:
      return extEnum.RICH
    case s.ZIP:
      return extEnum.ZIP
    default:
      throw Error(`Unknown attachment media type ${e}`)
  }
}
function f(e) {
  switch (e) {
    case extEnum.IMAGE:
      return s.IMAGE
    case extEnum.PDF:
      return s.PDF
    case extEnum.VIDEO:
      return s.VIDEO
    case extEnum.RICH:
      return s.RICH
    case extEnum.ZIP:
      return s.ZIP
    default:
      throw Error(`Unknown media type ${e}`)
  }
}
function v(e) {
  if (!e) return "0"
  const t = Math.min(Math.floor(Math.log(e) / Math.log(1000)), 3),
    i = ["B", "kB", "MB", "GB"][t]
  return `${Number((e / Math.pow(1000, t)).toFixed(1))}${i}`
}
export default {
  X3: p,
  bY: g,
  VV: v,
  fy: h,
  lV: d,
  Uq: c,
  m: f,
  id: m,
  xf: u
}
